<?php
include_once("functions/db_manipulate.php");

if (!init()) {
    redirect("?action=login");
    exit();
}

?>
    <meta charset="UTF-8">

<?php

connectDB();
startTransaction();

$resultSet = mysql_query("DELETE FROM news WHERE id = '" . mysql_real_escape_string($_GET['nid']) . "'") or die(mysql_error());

if ($resultSet) {
    commitTransaction();
} else {
    rollbackTransaction();
}

redirect($_SERVER['HTTP_REFERER']);